package com.danicsoft.daide.command;

import com.danicsoft.daide.token.TokenGroup;

/**
 * Implement this interface if you wish to recieve notification of when a
 * command is recieved. Then, add yourself as a listener to
 * <code>TokenParser</code> and you're off to the races.
 * 
 * @author Daniel Yule (daniel.yule@gmail.com)
 * @version 1.0
 */
public interface CommandHandler {
	/**
	 * A command has been recieved. This command's status is always
	 * TRANSMITTING.
	 * 
	 * @param command
	 *        The <code>Command</code> we have recieved.
	 */
	public void CommandReceived(Command command);

	/**
	 * A command that we have previously sent has been accepted by the other
	 * side. This command's status is always ACCEPTED.
	 * 
	 * @param command
	 *        The <code>Command</code> that has been accepted.
	 */
	public void CommandAccepted(Command command);

	/**
	 * A command that we have previously sent has been rejected by the other
	 * side. This command's status is always REJECTED.
	 * 
	 * @param command
	 *        The <code>Command</code> that has been rejected.
	 */
	public void CommandRejected(Command command);

	/**
	 * A command that we recieved which we could not parse.
	 * 
	 * @param commandGroup
	 *        The TokenGroup which contains the problem.
	 * @param parsingProblem
	 *        A String describing the reason for the problem,
	 */
	public void CommandError(TokenGroup commandGroup, String parsingProblem);
}
